<app:page xmlns:h="http://java.sun.com/jsf/html"
          xmlns:app="http://java.sun.com/jsf/composite/app"
          xmlns:ds="http://deltaset.org/deltaset-faces"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          id="community-page"
          pageTitle="#{communityMsg['view.title']}">

    <ds:titlebar title="#{communityMsg['view.title']}">
        <h:button outcome="/secured/community/form" 
                  value="#{deltasetMessages['deltaset.crud.add']}"
                  styleClass="ds-button"/>
        <h:button outcome="/secured/community/list" 
                  value="#{deltasetMessages['deltaset.crud.list']}"
                  styleClass="ds-button"/>
    </ds:titlebar>
    <c:set target="#{viewScope}" property="communityModel" value="#{communityBean.loadModel(param.communityId)}"/>

    <ds:fieldset>

        <ds:outputText label="#{communityMsg['groupName']}" value="#{viewScope.communityModel.groupName}"/>
    </ds:fieldset>
    

    <ui:include src="/secured/user/many-to-one.xhtml">
        <ui:param name="userModel" value="#{viewScope.communityModel.owner}"/>
    </ui:include>        

     
    
    <div class="ds-margin-top">
        <h:button outcome="/secured/community/form" 
                  value="#{deltasetMessages['deltaset.crud.edit']}"
                  styleClass="ds-button">
            <f:param name="communityId" value="#{viewScope.communityModel.id}"/>
        </h:button>
        <h:form>
            <h:commandButton value="#{deltasetMessages['deltaset.crud.delete']}"
                             action="#{communityBean.delete(viewScope.communityModel)}"
                             onclick="return deltaset.confirm(this)"
                             styleClass="ds-button">
                <f:param name="communityId" value="#{viewScope.communityModel.id}"/>
            </h:commandButton>
        </h:form>
    </div>


    <ui:include src="/secured/friend/list-by-community.xhtml">
        <ui:param name="communityId" value="#{viewScope.communityModel.id}"/>
    </ui:include>    

 

</app:page>